using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
using UnityEngine;

public class EnterDialog : MonoBehaviour
{
    public GameObject enterDialog;
    public GameObject loadManager;
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E) && enterDialog.activeInHierarchy)
        {
            //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
            LoadManager_Level.instance.LoadEvent();
        }
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            enterDialog.SetActive(true);
        }
    }
    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            enterDialog.SetActive(false);
        }
    }
}
